package com.tj.collection.enums;

/**
 * 订单类型枚举
 * Created with IntelliJ IDEA.
 * User: pavan
 * Date: 2019/9/9
 * Time: 下午6:12
 */
public enum ClBorrowTypeEnum {
    NEW(1, "新订单"),
    REPEAT(2, "复借");

    private Integer type;

    private String desc;

    ClBorrowTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public  ClBorrowTypeEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public  ClBorrowTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static  ClBorrowTypeEnum getEnum(Integer type) {
        for ( ClBorrowTypeEnum e :  ClBorrowTypeEnum.values()) {
            if (e.getType().equals(type)) {
                return e;
            }
        }
        return null;
    }
}
